home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 104 / MacAddict_104_2005-04.iso / Software / Internet & Communication / WordPress 1.2.2 freeware.dmg / wordpress / wp-includes / class-smarty.php < prev    next >
Encoding:
PHP Script  |  2003-12-11  |  6.2 KB  |  263 lines

  1. <?php
  2.  
  3. if( is_object( $wpsmarty ) == false )
  4. {
  5.     return;
  6. }
  7.  
  8. function smarty_bloginfo( $params ) 
  9. {
  10.     $show = '';
  11.     $display = true;
  12.     extract( $params );
  13.     return bloginfo($show, $display);
  14. }
  15. $wpsmarty->register_function( 'bloginfo', 'smarty_bloginfo' );
  16.  
  17. function smarty_bloginfo_rss( $params )
  18. {
  19.     $show = '';
  20.     extract( $params );
  21.     return bloginfo_rss($show);
  22. }
  23. $wpsmarty->register_function( 'bloginfo_rss', 'smarty_bloginfo_rss' );
  24.  
  25. function smarty_bloginfo_unicode( $params )
  26. {
  27.     $show = '';
  28.     extract( $params );
  29.     return bloginfo_unicode( $show );
  30. }
  31. $wpsmarty->register_function( 'bloginfo_unicode', 'smarty_bloginfo_unicode' );
  32.  
  33. function smarty_get_bloginfo( $params )
  34. {
  35.     $show = '';
  36.     extract( $params );
  37.     return get_bloginfo( $show );
  38. }
  39. $wpsmarty->register_function( 'get_bloginfo', 'smarty_get_bloginfo' );
  40.  
  41. function smarty_single_post_title( $params )
  42. {
  43.     $display = '';
  44.     $prefix = '';
  45.     extract( $params );
  46.     return single_post_title( $prefix, $display );
  47. }
  48. $wpsmarty->register_function( 'single_post_title', 'smarty_single_post_title' );
  49.  
  50. function smarty_single_cat_title( $params )
  51. {
  52.     $display = '';
  53.     $prefix = '';
  54.     extract( $params );
  55.     return single_cat_title( $prefix, $display );
  56. }
  57. $wpsmarty->register_function( 'single_cat_title', 'smarty_single_cat_title' );
  58.  
  59. function smarty_single_month_title( $params )
  60. {
  61.     $display = '';
  62.     $prefix = '';
  63.     extract( $params );
  64.     return single_month_title( $prefix, $display );
  65. }
  66. $wpsmarty->register_function( 'single_month_title', 'smarty_single_month_title' );
  67.  
  68. function smarty_get_archives_link( $params )
  69. {
  70.     $format = 'html';
  71.     $before = '';
  72.     $after = '';
  73.     extract( $params );
  74.     return get_archives_link( $url, $text, $format, $before, $after );
  75. }
  76. $wpsmarty->register_function( 'single_month_title', 'smarty_single_month_title' );
  77.  
  78. function smarty_get_archives( $params )
  79. {
  80.     $type = '';
  81.     $limit = '';
  82.     $format = 'html';
  83.     $before = '';
  84.     $after = '';
  85.     extract( $params );
  86.     return get_archives( $type, $limit, $format, $before, $after );
  87. }
  88. $wpsmarty->register_function( 'get_archives', 'smarty_get_archives' );
  89.  
  90. function smarty_the_date_xml()
  91. {
  92.     return the_date_xml();
  93. }
  94. $wpsmarty->register_function( 'the_date_xml', 'smarty_the_date_xml' );
  95.  
  96. function smarty_the_date( $params )
  97. {
  98.     $d = '';
  99.     $before = '';
  100.     $after = '';
  101.     $echo = true;
  102.     extract( $params );
  103.     return the_date( $d, $before, $after, $echo );
  104. }
  105. $wpsmarty->register_function( 'the_date', 'smarty_the_date' );
  106.  
  107. function smarty_the_time( $params )
  108. {
  109.     $d = '';
  110.     $echo = true;
  111.     extract( $params );
  112.     return the_time( $d, $echo );
  113. }
  114. $wpsmarty->register_function( 'the_time', 'smarty_the_time' );
  115.  
  116. function smarty_the_weekday()
  117. {
  118.     return the_weekday();
  119. }
  120. $wpsmarty->register_function( 'the_weekday', 'smarty_the_weekday' );
  121.  
  122. function smarty_the_weekday_date( $params )
  123. {
  124.     $before='';
  125.     $after='';
  126.     extract( $params );
  127.     return the_weekday_date( $before, $after );
  128.  
  129. }
  130. $wpsmarty->register_function( 'the_weekday_date', 'smarty_the_weekday_date' );
  131.  
  132. function smarty_get_Lat() {
  133.     return get_Lat();
  134. }
  135. $wpsmarty->register_function( 'get_Lat', 'smarty_get_Lat' );
  136.  
  137. function smarty_get_Lon() {
  138.     return get_Lon();
  139. }
  140. $wpsmarty->register_function( 'get_Lon', 'smarty_get_Lon' );
  141.  
  142. function smarty_the_ID()
  143. {
  144.     return the_ID();
  145. }
  146. $wpsmarty->register_function( 'the_ID', 'smarty_the_ID' );
  147.  
  148. function smarty_permalink_link( $params )
  149. {
  150.     $file='';
  151.     $mode = 'id';
  152.     extract( $params );
  153.     return permalink_link( $file, $mode );
  154. }
  155. $wpsmarty->register_function( 'permalink_link', 'smarty_permalink_link' );
  156.  
  157. function smarty_the_title( $params )
  158. {
  159.     $before='';
  160.     $after='';
  161.     $echo=true;
  162.     extract( $params );
  163.     return the_title( $before, $after, $echo);
  164. }
  165. $wpsmarty->register_function( 'the_title', 'smarty_the_title' );
  166.  
  167. function smarty_the_category_ID( $params )
  168. {
  169.     $echo=true;
  170.     extract( $params );
  171.     return the_category_ID( $echo );
  172. }
  173. $wpsmarty->register_function( 'the_category_ID', 'smarty_the_category_ID' );
  174. $wpsmarty->register_function( 'the_category', 'the_category' );
  175. $wpsmarty->register_function( 'the_author', 'the_author' );
  176.  
  177. function smarty_the_content( $params )
  178. {
  179.     $more_link_text='(more...)';
  180.     $stripteaser=0;
  181.     $more_file='';
  182.     extract( $params );
  183.     return the_content( $more_link_text, $stripteaser, $more_file );
  184. }
  185. $wpsmarty->register_function( 'the_content', 'smarty_the_content' );
  186.  
  187. function smarty_link_pages( $params )
  188. {
  189.     $before='<br />';
  190.     $after='<br />';
  191.     $next_or_number='number';
  192.     $nextpagelink='next page';
  193.     $previouspagelink='previous page';
  194.     $pagelink='%';
  195.     $more_file='';
  196.     extract( $params );
  197.     return link_pages( $before, $after, $next_or_number, $nextpagelink, $previouspagelink, $pagelink, $more_file);
  198. }
  199. $wpsmarty->register_function( 'link_pages', 'smarty_link_pages' );
  200.  
  201. function smarty_comments_popup_link( $params )
  202. {
  203.     $zero='No Comments';
  204.     $one='1 Comment';
  205.     $more='% Comments';
  206.     $CSSclass='';
  207.     $none='Comments Off';
  208.     extract( $params );
  209.     return comments_popup_link( $zero, $one, $more, $CSSclass, $none );
  210. }
  211. $wpsmarty->register_function( 'comments_popup_link', 'smarty_comments_popup_link' );
  212.  
  213. function smarty_trackback_rdf( $params )
  214. {
  215.     $timezone = 0;
  216.     extract( $params );
  217.     return trackback_rdf( $timezone );
  218. }
  219. $wpsmarty->register_function( 'trackback_rdf', 'smarty_trackback_rdf' );
  220.  
  221. function smarty_comments_popup_script( $params )
  222. {
  223.     $width=400;
  224.     $height=400;
  225.     $file='wp-comments-popup.php';
  226.     extract( $params );
  227.     return comments_popup_script( $width, $height, $file );
  228. }
  229. $wpsmarty->register_function( 'comments_popup_script', 'smarty_comments_popup_script' );
  230.  
  231. function smarty_get_links( $params )
  232. {
  233.     extract($params);
  234.         get_links($category, $before, $after, $between, $show_images, $orderby, $show_description, $show_rating, $limit, $show_updated, true );
  235. }
  236. $wpsmarty->register_function( 'get_links', 'smarty_get_links' );
  237.  
  238. function smarty_list_cats( $params )
  239. {
  240.     extract($params);
  241.     list_cats($optionall, $all, $sort_column, $sort_order, $file, $list, $optiondates, $optioncount, $hide_empty);
  242. }
  243. $wpsmarty->register_function( 'list_cats', 'smarty_list_cats' );
  244.  
  245. function smarty_timer_stop( $params )
  246. {
  247.     $display = 0;
  248.     $precision = 3;
  249.     extract($params);
  250.     timer_stop( $display, $precision );
  251. }
  252. $wpsmarty->register_function( 'timer_stop', 'smarty_timer_stop' );
  253.  
  254. function smarty_get_calendar( $params )
  255. {
  256.     $daylength = 1;
  257.     extract($params);
  258.     get_calendar( $daylength );
  259. }
  260. $wpsmarty->register_function( 'get_calendar', 'smarty_get_calendar' );
  261.  
  262. ?>
  263.